package com.airobot.candidates.mapper;

import com.airobot.candidates.entity.InterviewQuestion;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

/**
 * 面试题目数据访问接口
 * 继承自MyBatis-Plus的BaseMapper，提供基础的CRUD操作
 */
@Mapper
public interface InterviewQuestionMapper extends BaseMapper<InterviewQuestion> {
    
    /**
     * 根据题目集ID列表获取题目
     * @param questionSetIds 题目集ID列表
     * @return 题目列表
     */
    @Select("SELECT * FROM interview_question WHERE problemset_id IN " +
            "<script>" +
            "   <foreach collection='list' item='id' open='(' separator=',' close=')'>" +
            "       #{id}" +
            "   </foreach>" +
            "</script>")
    List<InterviewQuestion> getQuestionsBySetIds(List<Integer> questionSetIds);
} 